<div class="sidebar-second order-navBox">
    <ul id="accordion" class="accordion">
        <li {if condition="in_array($Request.action, ['settings', 'avd_index', 'links_index', 'variables_index', 'article_index'])"}class="open"{/if}>
            <a class="link">设置<i class="fa fa-angle-right"></i></a>
            <ul class="submenu" {if condition="in_array($Request.action, ['settings', 'avd_index', 'links_index', 'variables_index', 'article_index'])"}style="display: show;"{else/}style="display: none;"{/if}>
                <li>
                    <a {if condition="in_array($Request.action, ['settings'])"}class="active"{/if} href="{:url('Pc/settings')}">基础设置</a>
                </li>
                <li>
                    <a {if condition="in_array($Request.action, ['avd_index'])"}class="active"{/if} href="{:url('Pc/avd_index')}">首页广告</a>
                </li>
                <li>
                    <a {if condition="in_array($Request.action, ['links_index'])"}class="active"{/if} href="{:url('Pc/links_index')}">友情链接</a>
                </li>
            </ul>
        </li>
        <li {if condition="in_array($Request.action, ['menus_list'])"}class="open"{/if}>
            <a class="link">导航管理<i class="fa fa-angle-right"></i></a>
            <ul class="submenu" {if condition="in_array($Request.action, ['menus_list'])"}style="display: show;"{else/}style="display: none;"{/if}>
                <li>
                    <a {if condition="in_array($position_id, [2])"}class="active"{/if} href="{:url('Pc/menus_list', ['position_id'=>2])}">顶部导航</a>
                </li>
                <li>
                    <a {if condition="in_array($position_id, [4])"}class="active"{/if} href="{:url('Pc/menus_list', ['position_id'=>4])}">底部导航</a>
                </li>
            </ul>
        </li>
    </ul>
</div>
<script>
$(function() {
	var Accordion = function(el, multiple) {
		this.el = el || {};
		this.multiple = multiple || false;

		// Variables privadas
		var links = this.el.find('.link');
		// Evento
		links.on('click', {el: this.el, multiple: this.multiple}, this.dropdown)
	};

	Accordion.prototype.dropdown = function(e) {
		var $el = e.data.el;
			$this = $(this);
			$next = $this.next();

		$next.slideToggle();
		$this.parent().toggleClass('open');

		if (!e.data.multiple) {
			$el.find('.submenu').not($next).slideUp().parent().removeClass('open');
		}
	};

	var accordion = new Accordion($('#accordion'), false);
	$('.submenu li').click(function () {
		$(this).addClass('current').siblings('li').removeClass('current');
	});
});
</script>